#ifndef SIMULATEWIDGET_H
#define SIMULATEWIDGET_H

#include <QWidget>
#include "common.h"
#include "dynamicmapmanagewindow.h"
#include <QTimer>
#include "json.h"
#include "JsonCheck.h"
#include <string>
#include <iostream>

class DynamicMapManageWindow;

namespace Ui {
class SimulateWidget;
}

class SimulateWidget : public QWidget
{
    Q_OBJECT
public:
    explicit SimulateWidget(QWidget *parent = 0);
    ~SimulateWidget();
    void add_id_combox();

    void simulate_data_init(XmlType type);
    void simulate_show_init(int all_num, XmlType type);

    bool is_skip_id(int id);
    void curr_id_add_one();
    void curr_id_reduce_one();
    //void simulate_find_pic(QString img_path);
    void get_items_change();
    void config_interval();
    void config_intervalall();
    void config_arriveall();
    void config_arrive();
    void config_all();

private slots:
    void simulate_timeout();

    void on_pushButtonStart_clicked();

    void on_pushButtonStop_clicked();

#ifdef __WIN32__
    void on_comboBoxType_currentIndexChanged(const QString &arg1);
#endif

private:
    Ui::SimulateWidget *ui;

    DynamicMapManageWindow *m_test_show;
    QString m_img_path;
    QString m_xml_path;
    QTimer m_simulate_timer;
    ProtocolData *m_data_simulate;
    QString m_skip_list_data;
    QString m_items_change_text;
    int m_all_station_num;
    int m_xml_type;
    int m_interval_time;
    bool m_auto_flag;
    bool m_interval_flag;
};

#endif // SIMULATEWIDGET_H
